<?php

namespace api\controller;

// +----------------------------------------------------------------------
// | 消息模板数据控制层
// +----------------------------------------------------------------------

use common\controller\VerifyController;
use common\exception\LogicException;
use common\service\SystemNotifyMessageDetailService;
use think\Request;

class SystemNotifyMessageDetailController extends VerifyController
{
    /**
     * @var SystemNotifyMessageDetailService
     */
    private $systemNotifyMessageDetailService;

    public function __construct()
    {
        parent::__construct();
        $this->systemNotifyMessageDetailService = new SystemNotifyMessageDetailService();
    }

    /**
     * 批量更新解决状态
     * @param Request $request
     * @return \think\Response
     * @throws \think\Exception
     */
    public function updateSolveStatus(Request $request)
    {
        try {
            $param = $request->param();
            $res = $this->systemNotifyMessageDetailService->updateSolveStatus($param['param']['filter'], $param['param']['is_solve']);
            return json(success_response("OK", $res));
        } catch (LogicException $e) {
            throw_strack_exception($e->getMessage(), $e->getCode());
        }
    }
}